<?php
ob_start();
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database"); 
if($_POST[userName] != '' && $_POST[password] != '' && $_POST[firstName] != '' && $_POST[lastName] != '')
{
$query="
INSERT INTO Account (userName, password, firstName, lastName, city, state, DOB, sex, bio, photo)
VALUES (
	'$_POST[userName]',
	MD5('$_POST[password]'),
	'$_POST[firstName]',
	'$_POST[lastName]',
	'$_POST[city]',
	'$_POST[state]',
	'$_POST[DOB]',
	'$_POST[sex]',
	'$_POST[bio]',
	'$_POST[photo]'
)";
}
if (!mysql_query($query)) {
  echo "Error inserting entry into Account: " . mysql_error();
}

mysql_close();
header("Location: index.php");
ob_flush();
?> 
